import request from '@/utils/request'

export function fetchList(data) {
  return request({
    url: '/channel/item/list',
    method: 'post',
    data
  })
}

export function canalList(params) {
  return request({
    url: '/channel/query/list',
    method: 'get',
    params
  })
}

export function createCanalItem(data) {
  return request({
    url: '/channel/item/add',
    method: 'post',
    data
  })
}

export function detail(param) {
  return request({
    url: '/channel/item/detail/' + param,
    method: 'get'
  })
}

export function updateCanalItem(data) {
  return request({
    url: '/channel/item/update',
    method: 'post',
    data
  })
}

export function setDiscountState(param) {
  return request({
    url: '/channel/item/state/set/' + param,
    method: 'post',

  })
}

export function deleteItem(data) {
  return request({
    url: '/channel/item/del',
    method: 'post',
    data
  })
}

export function changeRate(data) {
  return request({
    url: '/channel/item/discount/set',
    method: 'post',
    data
  })
}
